import java.io.IOException;
import java.net.*;

public class one {

    public static void main(String[] args) throws IOException {
//        InetAddress inetAddress = InetAddress.getLocalHost();
//        System.out.println(inetAddress.getHostAddress());
//        System.out.println(inetAddress.getHostName());
//
//
//        InetAddress byname = InetAddress.getByName("192.168.1.222");
//        System.out.println(byname.getHostName());
//
//        // UDP
//        // 创建socket
//        DatagramSocket datagramSocket = new DatagramSocket();
//
//        //准备通信数据
//        String message = "Look at me";
//        DatagramPacket datagramPacket = new DatagramPacket(message.getBytes(), message.getBytes().length, InetAddress.getByName("localhost"), 8888);
//
//        //发送
//        datagramSocket.send(datagramPacket);
//
//
//        datagramSocket.close();

        Thread udpreceive = new Thread(new UDPRECEIVE(new DatagramSocket(8888)));
        udpreceive.start();

    }



}
